<template>
	<view class="add_arcguves">
		<view class="add_data" @click="goToIncreaseHeight('add')">
			<text> + 添加身高体重</text>
		</view>
		<view class="data_list">推荐DMI大于24的痛友每周测一次体重</view>

		<!-- 数据列表 -->
		<view class="height_wight_list" @click="goToIncreaseHeight('query')" v-if="heightWightList.wight">
			<view class="hwl_fl"> 
				<view><text style="margin-right: 10rpx;">{{heightWightList.height}}kg</text><text>{{heightWightList.wight}}cm</text> </view>
				<view><text ></text style="margin-right: 10rpx;">DMI<text>{{heightWightList.BMI}}</text> </view>
			</view>
			<view class="hwl_fr">
				<text>{{heightWightList.wight_time}}</text>
				<image class="hwl_fr_img" :src="require('../../status/image/arr.png')" mode=""></image>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				heightWightList: {}
			};
		},
		onShow() {
			this.getHeightWight()
		},
		methods: {
			goToIncreaseHeight(type) {
				uni.navigateTo({
					url: '../increaseHeight/index?type=' + type
				})
			},
			// 查询身高
			getHeightWight() {
				this.$api.sendRequest({
					url: '/api/health/heightWight',
					success: res => {
						if (res.code >= 0) { 
							this.heightWightList = res.data
							console.log(this.heightWightList)
						}
					}
				})
			}
		}
	}
</script>

<style lang="less">
	.add_arcguves {
		.add_data {
			margin: 10rpx 0;
			height: 80rpx;
			line-height: 80rpx;
			text-align: center;
			background-color: #fff;
		}

		.data_list {
			padding: 0 10rpx;
			height: 70rpx;
			line-height: 70rpx;
			font-size: 24rpx;
			background-color: #fff;
		}

		.height_wight_list {
			padding: 0 20rpx;
			display: flex;
			justify-content: space-between;
			height: 100rpx;
			line-height: 100rpx;
			background-color: #fff;
			border-top: 2rpx solid #eee;
			.hwl_fl,
			.hwl_fr {
				flex: 1;
			}
			.hwl_fl{
				display: flex;
				flex-direction: column;
			}
			.hwl_fr{
				text-align: right;
				line-height: 100rpx;
				.hwl_fr_img{
					margin-left: 40rpx;
					width: 35rpx;
					height: 35rpx;
					vertical-align: middle;
				}
			}
		}
	}
</style>
